package com.situ.mall.controller.front;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.situ.mall.entity.Category;
import com.situ.mall.service.ICategoryService;
import com.situ.mall.service.impl.CategoryServiceImpl;

@Controller
public class FrontIndexController {
	@Autowired
	private ICategoryService categoryService;
	
	@RequestMapping(value="/index.shtml")
	public String index(Model model) {
		List<Category> topCategoryList = categoryService.selectTop();
		model.addAttribute("topCategoryList",topCategoryList);
		List<Category> secondCategoryList = categoryService.selectsecond();
		model.addAttribute("secondCategoryList",secondCategoryList);
		return "index";
	}
}
